package src.lab03.test07;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/**
 * Created by 12442 on 2017/12/20.
 */
public class Test {
    public static void main(String[] args) {
        //7、	读取book.zip,并将book.zip中含有的文件重新存放到当前目录中的book文件夹中，
        // 即将book.zip的内容解压到book文件夹中。

        String path = "D:\\hello.zip ";
        ZipInputStream zipInputStream = null;
        try {
            zipInputStream = new ZipInputStream(new FileInputStream(path));

            ZipEntry entry;
            while ((entry = zipInputStream.getNextEntry())!= null){
                System.out.println(entry.getName());
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

        finally {

        }
    }
}
